package movee.spring.app.template.api.doc;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * knife4j API文档配置
 *
 * @author movee
 */
@Configuration
@EnableOpenApi
public class Knife4jConfig {

    @Bean(value = "oasConfig")
    public Docket oasConfig() {
        Docket docket=new Docket(DocumentationType.OAS_30)
                .apiInfo(new ApiInfoBuilder()
                        .title("app-template")
                        .description("应用程序框架")
                        .version("v1")
                        .build())
                .groupName("app-template-v1")
                .select()
                .apis(RequestHandlerSelectors.basePackage("movee.spring.app.template.api.v1"))
                .paths(PathSelectors.any())
                .build();
        return docket;
    }

}
